<script>
    $(document).ready(function () {
        //hide a div after 3 seconds
        setTimeout(function(){ $(".information-box, .error-box").fadeOut(); }, 3000);
    });
    function subform(){
        $('#kform').submit();
    }
    
    function checkAll()
    {
        $('#table-select-all').attr('onclick','uncheckAll();');
    	var field=document.forms.kform;
        for (i = 0; i < field.length; i++)
    	field[i].checked = true ;
    }
    
    function uncheckAll()
    {
        $('#table-select-all').attr('onclick','checkAll();')
    	var field=document.forms.kform;
        for (i = 0; i < field.length; i++)
    	field[i].checked = false ;
    }
    
    $(document).ready(function() {
                        $("#kform").validate({
                    			rules: {
                    				/*bill_no: {
                    					required: true,
                    					minlength: 3,
                    					maxlength: 200
                    				},*/
                                    codestaff: {
                    					required: true,					
                    				},
                    				firstname: {
                    					required: true,	
                                        maxlength: 30				
                    				},
                    				lastname: {
                    					required: true,	
                                        maxlength: 30				
                    				},
                    				address: {
                    					required: true,					
                    				},
                    				mobile: {
                    					required: true,	
                                        number:true, 
                                        rangelength:[6,13],			
                    				}
                    			},
                    			messages: {
                    				/*bill_no: {
                    					required: "Please Enter Bill Number",
                                                            minlength: "Bill Number must consist of at least 3 characters"
                    				},*/
                                    codestaff: {
                    					required: "Please Enter Code Staff"					
                    				},
                    				firstname: {
                    					required: "Please Enter First Name",
                                        required: "The First Name field can not be greater than 30 character.",
                    				},
                    				lastname: {
                    					required: "Please Enter Last Name",
                                        required: "The Last Name field can not be greater than 30 character.",
                    				},
                    				address: {
                    					required: "Please Enter Address"
                    				},
                    				mobile: {
                    					required: "Please Enter Mobile",
                                        required: "Mobile Must Number",
                                        required: "Mobile must consist of at least 6 to 13 characters"
                    				}                   				
                    			}
                    		});
                      }) 

</script>